/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Demo;

/**
 *
 * @author RULMAN
 */
import java.io.*;
public class DeserializacionPersona {
    
    public static void main(String[] args){
       CPersona persona1=null;
       
         try {
            //abrir o recuperar un archivo de disco
            FileInputStream fis=new FileInputStream("persona1.ser");
            //Stream para recuperar o reconstruir objetos
            ObjectInputStream ois=new ObjectInputStream(fis);
            //el metedo readObject() recupera el objeto
            persona1=(CPersona) ois.readObject();
           ois.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }catch(IOException e){
            e.printStackTrace();
        }catch(ClassNotFoundException e){
            e.printStackTrace();
        }
        System.out.println(persona1.toString());
       
    }
   }
    

